/**
 * @Description:
 * @Author: saqqdy
 * @LastEditors: saqqdy
 * @Date: 2021-07-18 00:39:35
 * @LastEditTime: 2021-07-18 12:01:24
 */
import { join } from 'path'

import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin'

import { isDev, rootDir } from '../utils/env'

const config = {
    async: isDev,
    typescript: {
        configFile: join(rootDir, '/tsconfig.json')
    },
    eslint: { enabled: true, files: '../src/**/*.{ts,tsx,js,jsx}' }
}

export const forkTsCheckerWebpackPlugin = new ForkTsCheckerWebpackPlugin(config)
